<?php echo $this->render('resource/keyword/_tab.phtml');?>
<form action="" method="post">
<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
<div class="body">
	<table class="form">
		<tr>
			<th colspan="2"><?php echo $this->language('KEYWORD INFORMATION');?>:</th>
		</tr>
		<tr>
			<td width="180"><label><span class="red">*</span> <?php echo $this->language('Name');?></label></td>
			<td>
				<?php
				if($this->row->getId()) {
					echo '<span class="show">' . $this->escape($this->row->getName()) . '</span>';
					echo $this->form()->hidden('name', $this->row->getName());
				} else {
					echo $this->form()->text('name', $this->row->getName(), array('size' => '20', 'maxlength' => '20'));
					echo '<code>' . $this->language('Between 1~50 characters') . '.</code>';
				}
				?>
			</td>
		</tr>
		<?php if(!$this->row->getId()) { ?>
		<tr>
			<th colspan="2"><?php echo $this->language('OR INSERT IN BATCHES');?>:</th>
		</tr>
		<tr>
			<td width="180"><label><span class="red">*</span> <?php echo $this->language('Keywords');?></label></td>
			<td><?php 
				echo $this->form()->textarea('keywords', $this->keywords, array('cols' => 70, 'rows' => '5'));
				echo '<code>' . $this->language('Separate each keywords by ";" or "," or Enter key') . '.</code>';
			?></td>
		</tr>
		<?php } ?>
		<tr>
			<td><label><?php echo $this->language('Actived');?></label></td>
			<td><?php echo $this->form()->select('is_active', $this->row->getIsActive(), array(), array('0' => 'No', '1' => 'Yes'));?></td>
		</tr>
		<tr>
			<td></td>
			<td colspan="2">
				<button type="submit" name="submit" value="submit"><?php echo $this->language('Submit');?></button>
				<?php
				if($this->row->getId()) {
					echo $this->render('include/deleteButton.phtml');
				}
				?>
			</td>
		</tr>
	</table>
</div>
</form>

<?php if($this->row->getId()) { ?>
<div class="body">
	<table class="form">
		<tr>
			<th><?php echo $this->language('KEYWORD IN SPECIAL');?>:</th>
		</tr>
		<tr>
			<td>
				<table class="list no-border">
					<?php foreach($this->specialList AS $row) { ?>
					<tr>
						<td class="icon"><a href="<?php echo $this->url('picture/special/photo', array('id' => $row->getId()));?>"><img src="<?php echo $row->getCover()->getThumb(false);?>" /></a></td>
						<td>
							<h3><a href="<?php echo $this->url('picture/special/edit', array('id' => $row->getId()));?>"><?php echo $this->escape($row->getTitle());?></a></h3>
							<div><?php echo $this->language('Creation Time')?>: <?php echo $this->date($row->getCreationtime());?></div>
							<h2><?php echo $row->getPtotal();?></h2><code>PHOTOs</code>
						</td>
					</tr>
					<?php } ?>
				</table>
			</td>
		</tr>
	</table>
</div>
<?php } ?>
